package com.jwaoo.mobile.view.login.model;

import android.content.Context;

import com.dx.as.common.ILoadListener;
import com.jwaoo.mobile.http.HttpHelper;

import java.util.Map;

import http.IHttpListener;

/**
 * Created by jwaoo on 2017/8/30.
 */

public class LoginModel extends IHttpListener implements IModleInterface{
    public LoginModel(Context context, ILoadListener loadListener) {
        super(context, loadListener);
    }

    @Override
    public int doLogin(Map map){
        return HttpHelper.doLogin(map,this);
    }

    @Override
    public int getAcctountInfo() {
        return HttpHelper.getAccountInfo(this);
    }

    @Override
    public int doActive() {
        HttpHelper.doActive();
        return 0;
    }

    @Override
    public void onResponse(Object response, int flg) {
        loadListener.onResponse(response,flg);
    }

    @Override
    public void onFailure(Throwable t) {
        loadListener.onFailure(t);
    }

    @Override
    public void onFilure(int code, String errorMsg) {
        loadListener.onFailure(code,errorMsg);
    }
}
